using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public enum DamageType {
	Projectile = 0,
	Explosion = 1,
	Melee = 2,
	Healing = 3,
	Pure = 4,
	OverTime=5,
}

public enum DamageElement {
	Normal,
	Electricity = 1,
	Fire=2
}


public class DamageStats:System.ICloneable {
	public StatFloat amount;
	public Mob attackerMob;
	public Weapon attackerWeapon;
	public Projectile attackerProjectile;
	public Vector2 position;
	public Vector2 knockback;
	public StatFloat elementEfficiency;
	public bool createParticles;
	public DamageType damageType;
	public DamageElement damageElement;
	public bool crit;
	public bool isComposition;
	public int destructionLevel;

	public DamageStats(DamageStats original) {
		amount=original.amount.Clone() as StatFloat;
		attackerMob=original.attackerMob;
		attackerWeapon=original.attackerWeapon;
		attackerProjectile=original.attackerProjectile;
		position=original.position;
		knockback=original.knockback;
		elementEfficiency=original.elementEfficiency.Clone() as StatFloat;
		createParticles=original.createParticles;
		damageType=original.damageType;
		damageElement=original.damageElement;
		crit=original.crit;
		isComposition=original.isComposition;
		destructionLevel=original.destructionLevel;
	}

	public DamageStats(
		float _amount = 0,
		Mob _attackerMob = null,
		Weapon _attackerWeapon = null,
		Projectile _attackerProjectile = null,
		Vector2 _position = new Vector2(),
		Vector2 _knockback = new Vector2(),
		float _elementEfficiency = 0,
		bool _createParticles = true,
		DamageType _damageType = DamageType.Projectile,
		DamageElement _damageElement = DamageElement.Normal,
		int _destructionLevel = 1,
		bool _crit = false,
		bool _isComposition = false
	) {
		amount=_amount;
		attackerMob=_attackerMob;
		attackerWeapon=_attackerWeapon;
		attackerProjectile=_attackerProjectile;
		position=_position;
		knockback=_knockback;
		elementEfficiency=_elementEfficiency;
		createParticles=_createParticles;
		damageType=_damageType;
		damageElement=_damageElement;
		crit=_crit;
		isComposition=_isComposition;
		destructionLevel=_destructionLevel;
	}

	public object Clone() => new DamageStats(this);


}
